<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="referrer" content="never">
    <title>jQ动画插件</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        ul {
            list-style: none;
        }

        .box{
            position: absolute;
            top: 50px;
            left: 50px;
            width: 150px;
            height: 150px;
            background-color: #f00;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <script src="../lib/jquery/jquery.min.js"></script>
    <script src="../lib/jquery/jquery.color.js"></script>
    <script src="../lib/jquery/jquery.easing.js"></script>
    <script type="text/javascript">
        /*
            jquery.color.js 给jQ添加颜色动画
            jquery.easing.js 给jQ添加时序函数
        */

        var $box = $(".box");

        $box.click(function (){
            // animate 的参数时递进的，会自动不齐
            $(this).animate({
                width: 300,
                backgroundColor: "#00f"
            }, 2000, "easeInCubic")
        })
    </script>
</body>
</html>